import fractions

f = fractions.Fraction(20 / 3)

print(f.as_integer_ratio(), f.limit_denominator(max_denominator=6))
print(f.limit_denominator(max_denominator=6))
